Integrand size = 39, antiderivative size = 181 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} a^2 (8 A+7 B+6 C) x+\frac {a^2 (8 A+7 B+6 C) \sin (c+d x)}{6 d}+\frac {a^2 (8 A+7 B+6 C) \cos (c+d x) \sin (c+d x)}{24 d}+\frac {(20 A-5 B+6 C) (a+a \cos (c+d x))^2 \sin (c+d x)}{60 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^2 \sin (c+d x)}{5 d}+\frac {(5 B+2 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{20 a d} \]
1/8*a^2*(8*A+7*B+6*C)*x+1/6*a^2*(8*A+7*B+6*C)*sin(d*x+c)/d+1/24*a^2*(8*A+7 *B+6*C)*cos(d*x+c)*sin(d*x+c)/d+1/60*(20*A-5*B+6*C)*(a+a*cos(d*x+c))^2*sin (d*x+c)/d+1/5*C*cos(d*x+c)^2*(a+a*cos(d*x+c))^2*sin(d*x+c)/d+1/20*(5*B+2*C )*(a+a*cos(d*x+c))^3*sin(d*x+c)/a/d
Time = 1.22 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.73 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {a^2 (420 B c+240 c C+480 A d x+420 B d x+360 C d x+60 (14 A+12 B+11 C) \sin (c+d x)+240 (A+B+C) \sin (2 (c+d x))+40 A \sin (3 (c+d x))+80 B \sin (3 (c+d x))+90 C \sin (3 (c+d x))+15 B \sin (4 (c+d x))+30 C \sin (4 (c+d x))+6 C \sin (5 (c+d x)))}{480 d} \]
(a^2*(420*B*c + 240*c*C + 480*A*d*x + 420*B*d*x + 360*C*d*x + 60*(14*A + 1 2*B + 11*C)*Sin[c + d*x] + 240*(A + B + C)*Sin[2*(c + d*x)] + 40*A*Sin[3*( c + d*x)] + 80*B*Sin[3*(c + d*x)] + 90*C*Sin[3*(c + d*x)] + 15*B*Sin[4*(c + d*x)] + 30*C*Sin[4*(c + d*x)] + 6*C*Sin[5*(c + d*x)]))/(480*d)
Time = 0.84 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.02, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.256, Rules used = {3042, 3524, 3042, 3447, 3042, 3502, 3042, 3230, 3042, 3123}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) (a \cos (c+d x)+a)^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3524 |
\(\displaystyle \frac {\int \cos (c+d x) (\cos (c+d x) a+a)^2 (a (5 A+2 C)+a (5 B+2 C) \cos (c+d x))dx}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (a (5 A+2 C)+a (5 B+2 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \frac {\int (\cos (c+d x) a+a)^2 \left (a (5 B+2 C) \cos ^2(c+d x)+a (5 A+2 C) \cos (c+d x)\right )dx}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (a (5 B+2 C) \sin \left (c+d x+\frac {\pi }{2}\right )^2+a (5 A+2 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {\frac {\int (\cos (c+d x) a+a)^2 \left (3 (5 B+2 C) a^2+(20 A-5 B+6 C) \cos (c+d x) a^2\right )dx}{4 a}+\frac {(5 B+2 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d}}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (3 (5 B+2 C) a^2+(20 A-5 B+6 C) \sin \left (c+d x+\frac {\pi }{2}\right ) a^2\right )dx}{4 a}+\frac {(5 B+2 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d}}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {\frac {\frac {5}{3} a^2 (8 A+7 B+6 C) \int (\cos (c+d x) a+a)^2dx+\frac {(20 A-5 B+6 C) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{3 d}}{4 a}+\frac {(5 B+2 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d}}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\frac {5}{3} a^2 (8 A+7 B+6 C) \int \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2dx+\frac {(20 A-5 B+6 C) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{3 d}}{4 a}+\frac {(5 B+2 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d}}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
\(\Big \downarrow \) 3123 |
\(\displaystyle \frac {\frac {\frac {5}{3} a^2 (8 A+7 B+6 C) \left (\frac {2 a^2 \sin (c+d x)}{d}+\frac {a^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3 a^2 x}{2}\right )+\frac {(20 A-5 B+6 C) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{3 d}}{4 a}+\frac {(5 B+2 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d}}{5 a}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^2}{5 d}\) |
(C*Cos[c + d*x]^2*(a + a*Cos[c + d*x])^2*Sin[c + d*x])/(5*d) + (((5*B + 2* C)*(a + a*Cos[c + d*x])^3*Sin[c + d*x])/(4*d) + (((20*A - 5*B + 6*C)*(a^2 + a^2*Cos[c + d*x])^2*Sin[c + d*x])/(3*d) + (5*a^2*(8*A + 7*B + 6*C)*((3*a ^2*x)/2 + (2*a^2*Sin[c + d*x])/d + (a^2*Cos[c + d*x]*Sin[c + d*x])/(2*d))) /3)/(4*a))/(5*a)
3.4.10.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^ 2)*(x/2), x] + (-Simp[2*a*b*(Cos[c + d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(S in[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_. ) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*(a + b*Sin[e + f*x] )^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n + 2))), x] + Simp[1/(b*d*(m + n + 2)) Int[(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*Simp[A*b*d*(m + n + 2) + C*(a*c*m + b*d*(n + 1)) + (C*(a*d*m - b*c*(m + 1)) + b*B*d*(m + n + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m, n} , x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && !Lt Q[m, -2^(-1)] && NeQ[m + n + 2, 0]
Time = 5.35 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.56
method | result | size |
parallelrisch | \(\frac {a^{2} \left (6 \left (A +B +C \right ) \sin \left (2 d x +2 c \right )+\left (A +2 B +\frac {9 C}{4}\right ) \sin \left (3 d x +3 c \right )+\frac {3 \left (\frac {B}{2}+C \right ) \sin \left (4 d x +4 c \right )}{4}+\frac {3 \sin \left (5 d x +5 c \right ) C}{20}+3 \left (7 A +6 B +\frac {11 C}{2}\right ) \sin \left (d x +c \right )+12 x \left (A +\frac {7 B}{8}+\frac {3 C}{4}\right ) d \right )}{12 d}\) | \(101\) |
parts | \(\frac {\left (2 A \,a^{2}+B \,a^{2}\right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (B \,a^{2}+2 a^{2} C \right ) \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {\left (A \,a^{2}+2 B \,a^{2}+a^{2} C \right ) \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {\sin \left (d x +c \right ) A \,a^{2}}{d}+\frac {a^{2} C \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5 d}\) | \(176\) |
risch | \(a^{2} x A +\frac {7 a^{2} B x}{8}+\frac {3 a^{2} C x}{4}+\frac {7 \sin \left (d x +c \right ) A \,a^{2}}{4 d}+\frac {3 \sin \left (d x +c \right ) B \,a^{2}}{2 d}+\frac {11 \sin \left (d x +c \right ) a^{2} C}{8 d}+\frac {a^{2} C \sin \left (5 d x +5 c \right )}{80 d}+\frac {\sin \left (4 d x +4 c \right ) B \,a^{2}}{32 d}+\frac {\sin \left (4 d x +4 c \right ) a^{2} C}{16 d}+\frac {\sin \left (3 d x +3 c \right ) A \,a^{2}}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2}}{6 d}+\frac {3 \sin \left (3 d x +3 c \right ) a^{2} C}{16 d}+\frac {\sin \left (2 d x +2 c \right ) A \,a^{2}}{2 d}+\frac {\sin \left (2 d x +2 c \right ) B \,a^{2}}{2 d}+\frac {\sin \left (2 d x +2 c \right ) a^{2} C}{2 d}\) | \(229\) |
derivativedivides | \(\frac {\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B \,a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a^{2} C \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+2 A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 B \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 a^{2} C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(247\) |
default | \(\frac {\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B \,a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {a^{2} C \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+2 A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 B \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 a^{2} C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(247\) |
norman | \(\frac {\frac {a^{2} \left (8 A +7 B +6 C \right ) x}{8}+\frac {7 a^{2} \left (8 A +7 B +6 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {a^{2} \left (8 A +7 B +6 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {5 a^{2} \left (8 A +7 B +6 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {5 a^{2} \left (8 A +7 B +6 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {5 a^{2} \left (8 A +7 B +6 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {5 a^{2} \left (8 A +7 B +6 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a^{2} \left (8 A +7 B +6 C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a^{2} \left (24 A +25 B +26 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {8 a^{2} \left (35 A +25 B +27 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {a^{2} \left (104 A +79 B +54 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(312\) |
1/12*a^2*(6*(A+B+C)*sin(2*d*x+2*c)+(A+2*B+9/4*C)*sin(3*d*x+3*c)+3/4*(1/2*B +C)*sin(4*d*x+4*c)+3/20*sin(5*d*x+5*c)*C+3*(7*A+6*B+11/2*C)*sin(d*x+c)+12* x*(A+7/8*B+3/4*C)*d)/d
Time = 0.25 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.67 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {15 \, {\left (8 \, A + 7 \, B + 6 \, C\right )} a^{2} d x + {\left (24 \, C a^{2} \cos \left (d x + c\right )^{4} + 30 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} + 8 \, {\left (5 \, A + 10 \, B + 9 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 15 \, {\left (8 \, A + 7 \, B + 6 \, C\right )} a^{2} \cos \left (d x + c\right ) + 8 \, {\left (25 \, A + 20 \, B + 18 \, C\right )} a^{2}\right )} \sin \left (d x + c\right )}{120 \, d} \]
integrate(cos(d*x+c)*(a+a*cos(d*x+c))^2*(A+B*cos(d*x+c)+C*cos(d*x+c)^2),x, algorithm="fricas")
1/120*(15*(8*A + 7*B + 6*C)*a^2*d*x + (24*C*a^2*cos(d*x + c)^4 + 30*(B + 2 *C)*a^2*cos(d*x + c)^3 + 8*(5*A + 10*B + 9*C)*a^2*cos(d*x + c)^2 + 15*(8*A + 7*B + 6*C)*a^2*cos(d*x + c) + 8*(25*A + 20*B + 18*C)*a^2)*sin(d*x + c)) /d
Leaf count of result is larger than twice the leaf count of optimal. 570 vs. \(2 (162) = 324\).
Time = 0.29 (sec) , antiderivative size = 570, normalized size of antiderivative = 3.15 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} A a^{2} x \sin ^{2}{\left (c + d x \right )} + A a^{2} x \cos ^{2}{\left (c + d x \right )} + \frac {2 A a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {A a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {A a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} + \frac {A a^{2} \sin {\left (c + d x \right )}}{d} + \frac {3 B a^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 B a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {B a^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 B a^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {B a^{2} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 B a^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {4 B a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {5 B a^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {2 B a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {B a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {3 C a^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 C a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 C a^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {8 C a^{2} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 C a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {3 C a^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {2 C a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {C a^{2} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {5 C a^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {C a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + a\right )^{2} \left (A + B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) \cos {\left (c \right )} & \text {otherwise} \end {cases} \]
Piecewise((A*a**2*x*sin(c + d*x)**2 + A*a**2*x*cos(c + d*x)**2 + 2*A*a**2* sin(c + d*x)**3/(3*d) + A*a**2*sin(c + d*x)*cos(c + d*x)**2/d + A*a**2*sin (c + d*x)*cos(c + d*x)/d + A*a**2*sin(c + d*x)/d + 3*B*a**2*x*sin(c + d*x) **4/8 + 3*B*a**2*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + B*a**2*x*sin(c + d* x)**2/2 + 3*B*a**2*x*cos(c + d*x)**4/8 + B*a**2*x*cos(c + d*x)**2/2 + 3*B* a**2*sin(c + d*x)**3*cos(c + d*x)/(8*d) + 4*B*a**2*sin(c + d*x)**3/(3*d) + 5*B*a**2*sin(c + d*x)*cos(c + d*x)**3/(8*d) + 2*B*a**2*sin(c + d*x)*cos(c + d*x)**2/d + B*a**2*sin(c + d*x)*cos(c + d*x)/(2*d) + 3*C*a**2*x*sin(c + d*x)**4/4 + 3*C*a**2*x*sin(c + d*x)**2*cos(c + d*x)**2/2 + 3*C*a**2*x*cos (c + d*x)**4/4 + 8*C*a**2*sin(c + d*x)**5/(15*d) + 4*C*a**2*sin(c + d*x)** 3*cos(c + d*x)**2/(3*d) + 3*C*a**2*sin(c + d*x)**3*cos(c + d*x)/(4*d) + 2* C*a**2*sin(c + d*x)**3/(3*d) + C*a**2*sin(c + d*x)*cos(c + d*x)**4/d + 5*C *a**2*sin(c + d*x)*cos(c + d*x)**3/(4*d) + C*a**2*sin(c + d*x)*cos(c + d*x )**2/d, Ne(d, 0)), (x*(a*cos(c) + a)**2*(A + B*cos(c) + C*cos(c)**2)*cos(c ), True))
Time = 0.22 (sec) , antiderivative size = 236, normalized size of antiderivative = 1.30 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{2} - 240 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 320 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} C a^{2} + 160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a^{2} - 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 480 \, A a^{2} \sin \left (d x + c\right )}{480 \, d} \]
integrate(cos(d*x+c)*(a+a*cos(d*x+c))^2*(A+B*cos(d*x+c)+C*cos(d*x+c)^2),x, algorithm="maxima")
-1/480*(160*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*a^2 - 240*(2*d*x + 2*c + s in(2*d*x + 2*c))*A*a^2 + 320*(sin(d*x + c)^3 - 3*sin(d*x + c))*B*a^2 - 15* (12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*B*a^2 - 120*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*a^2 - 32*(3*sin(d*x + c)^5 - 10*sin(d*x + c)^ 3 + 15*sin(d*x + c))*C*a^2 + 160*(sin(d*x + c)^3 - 3*sin(d*x + c))*C*a^2 - 30*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*C*a^2 - 480*A* a^2*sin(d*x + c))/d
Time = 0.35 (sec) , antiderivative size = 160, normalized size of antiderivative = 0.88 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {C a^{2} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {1}{8} \, {\left (8 \, A a^{2} + 7 \, B a^{2} + 6 \, C a^{2}\right )} x + \frac {{\left (B a^{2} + 2 \, C a^{2}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (4 \, A a^{2} + 8 \, B a^{2} + 9 \, C a^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (A a^{2} + B a^{2} + C a^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (14 \, A a^{2} + 12 \, B a^{2} + 11 \, C a^{2}\right )} \sin \left (d x + c\right )}{8 \, d} \]
1/80*C*a^2*sin(5*d*x + 5*c)/d + 1/8*(8*A*a^2 + 7*B*a^2 + 6*C*a^2)*x + 1/32 *(B*a^2 + 2*C*a^2)*sin(4*d*x + 4*c)/d + 1/48*(4*A*a^2 + 8*B*a^2 + 9*C*a^2) *sin(3*d*x + 3*c)/d + 1/2*(A*a^2 + B*a^2 + C*a^2)*sin(2*d*x + 2*c)/d + 1/8 *(14*A*a^2 + 12*B*a^2 + 11*C*a^2)*sin(d*x + c)/d
Time = 2.78 (sec) , antiderivative size = 322, normalized size of antiderivative = 1.78 \[ \int \cos (c+d x) (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (2\,A\,a^2+\frac {7\,B\,a^2}{4}+\frac {3\,C\,a^2}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {28\,A\,a^2}{3}+\frac {49\,B\,a^2}{6}+7\,C\,a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {56\,A\,a^2}{3}+\frac {40\,B\,a^2}{3}+\frac {72\,C\,a^2}{5}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {52\,A\,a^2}{3}+\frac {79\,B\,a^2}{6}+9\,C\,a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (6\,A\,a^2+\frac {25\,B\,a^2}{4}+\frac {13\,C\,a^2}{2}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {a^2\,\mathrm {atan}\left (\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (8\,A+7\,B+6\,C\right )}{4\,\left (2\,A\,a^2+\frac {7\,B\,a^2}{4}+\frac {3\,C\,a^2}{2}\right )}\right )\,\left (8\,A+7\,B+6\,C\right )}{4\,d}-\frac {a^2\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,\left (8\,A+7\,B+6\,C\right )}{4\,d} \]
(tan(c/2 + (d*x)/2)^9*(2*A*a^2 + (7*B*a^2)/4 + (3*C*a^2)/2) + tan(c/2 + (d *x)/2)^7*((28*A*a^2)/3 + (49*B*a^2)/6 + 7*C*a^2) + tan(c/2 + (d*x)/2)^3*(( 52*A*a^2)/3 + (79*B*a^2)/6 + 9*C*a^2) + tan(c/2 + (d*x)/2)^5*((56*A*a^2)/3 + (40*B*a^2)/3 + (72*C*a^2)/5) + tan(c/2 + (d*x)/2)*(6*A*a^2 + (25*B*a^2) /4 + (13*C*a^2)/2))/(d*(5*tan(c/2 + (d*x)/2)^2 + 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2)^6 + 5*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 + 1)) + (a^2*atan((a^2*tan(c/2 + (d*x)/2)*(8*A + 7*B + 6*C))/(4*(2*A*a^2 + (7*B*a^2)/4 + (3*C*a^2)/2)))*(8*A + 7*B + 6*C))/(4*d) - (a^2*(atan(tan(c/ 2 + (d*x)/2)) - (d*x)/2)*(8*A + 7*B + 6*C))/(4*d)